package servlet.demo;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

/**
 * Create By IntelliJ IDEA
 *
 * @Author: jsonor
 * @Create-Time: 2017/9/26 8:22
 * @Description: Demo
 */
public class DemoServlet extends HttpServlet {

  // 所有继承于DemoServlet的类都可以共享
  private static int count = 0;

  @Override
  public void destroy() {

    // Todo..
    // save count to database
    // service.save(count)
  }

  @Override
  public void init() throws ServletException {

    // Todo..
    // read count from database
    // count = service.getCount()


  }

  public void asc() { count++; }
}
